import { getStore, setStore, removeStore } from '@/util/store'

const dict = {
    state: {
        // workshopId: '',
        repairStation: {
            workshopId: '',
            centerId: ''
        }
    },
    mutations: {
        SET_REPAIR_STATION: (state, { workshopId, centerId }) => {
            state.repairStation.workshopId = workshopId || '';
            state.repairStation.centerId = centerId || '';
            setStore({ name: 'repair', content: { workshopId, centerId } })
        },
        GET_REPAIR_STATION: (state) => {
            let repair = getStore({ name: 'repair' }) || {}
            state.repairStation.workshopId = repair.workshopId || '';
            state.repairStation.centerId = repair.centerId || '';
        },
        REMOVE_REPAIR_STATION: () => {
            removeStore({

                name: 'repair'
            })
        }
    }
};

export default dict;
